import math
from urllib import request
import requests
res = requests.get('https://www.baidu.com')
pagetext = res.text
print(pagetext)
text = open ('./baidu.html','w',encoding = 'utf-8')
text.write(pagetext)

resimg = requests.get('https://www.baidu.com/img/bd_logo1.png')
image = open('./img.png','wb')
image.write(resimg.content)

